Add support for PostgreSQL Insert table aliases (#1069)#1084
Merged
alamb merged 1 commit intoapache:mainfrom Jan 14, 2024
Merged
Add support for PostgreSQL Insert table aliases (#1069)#1084alamb merged 1 commit intoapache:mainfrom
alamb merged 1 commit intoapache:mainfrom
Conversation
Pull Request Test Coverage Report for Build 7513619314
💛 - Coveralls |
alamb
reviewed
Jan 6, 2024
Contributor
alamb
left a comment
There was a problem hiding this comment.
Thank you for this contribution @boydjohnson - this is looking close.
Comment on lines
+2417
to
+2422
| let table_name = if let Some(Ident { | ||
| value, | ||
| quote_style: _, | ||
| }) = table_alias | ||
| { | ||
| format!("{table_name} AS {value}") |
Contributor
There was a problem hiding this comment.
It seems like we should format the alias using whatever quote style was originally used
Maybe something like
Suggested change
| let table_name = if let Some(Ident { | |
| value, | |
| quote_style: _, | |
| }) = table_alias | |
| { | |
| format!("{table_name} AS {value}") | |
| let table_name = if let Some(table_alias) = table_alias | |
| { | |
| format!("{table_name} AS {table_alias}") |
Contributor
Author
There was a problem hiding this comment.
Thanks, I followed your advice. I rebased and force-pushed. I hope that is ok.
|
|
||
| pg().verified_stmt(sql1); | ||
|
|
||
| let sql2 = "INSERT INTO test_tables AS test_table (id, a) VALUES (DEFAULT, 123)"; |
Contributor
There was a problem hiding this comment.
Could you please:
- Make the
sql2a second test (e.g.test_simple_postgres_insert_with_alias) - Add a test for a quoted identifier, something like
INSERT INTO test_tables AS "Test_Table" (id, a) VALUES (DEFAULT, 123), perhaps
930ea2f to
647ddce
Compare
9 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a fix for #1069